Add __FILE__/__LINE__ preprocessor directives (VAMS-2023) - #25
Merged
Conversation
Expand the IEEE/VAMS §10.7 directives to string and decimal literals, tracking the current input file across `include and expanding nested uses inside `define bodies at the call site. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
sai-v-ch
added a commit
to sai-v-ch/OpenVAF-Reloaded
that referenced
this pull request
Aug 1, 2026
Resolves the overlap with OpenVAF#25 (`__FILE__/`__LINE__): - CompilerDirective gains both pairs of variants. - parse_macro_token keeps OpenVAF#25's match form, which already contains the bump() fix this branch added independently; extended the comment to say it covers every directive that is invalid in a `define body. - Processor carries both the keyword stack/LexerState and expand_seq. - expand_file_line's Token now sets the new `keywords` field (semantic conflict git could not see - the field was added by this branch).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
`__FILE__/`__LINE__(VAMS-2023 §10.7 / Mantis 7912).`include(reverts to the parent afterward).`definebodies expand at the macro call site (e.g.`define LOC `__FILE__, `__LINE__).SourceProvider::allocate_virtual_filehook so green-tree token text stays file-backed.Test plan
timeout 90s cargo test -p preprocessor --jobs 1(8/8)`include, inside`definecargo check -p basedb --jobs 1cargo fmt -p preprocessor -p basedbMade with Cursor